﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ForzaGT3.Data;

namespace ForzaGT3.Controllers
{
    public partial class ContactUsController : Controller
    {
        //
        // GET: /ContactUs/

        public virtual ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public virtual ActionResult Index(Contact model)
        {
            if (ModelState.IsValid)
            {
                model.ContactId = Guid.NewGuid();
                model.CreatedDate = DateTime.Now;
                model.Insert();

                return RedirectToAction(MVC.ContactUs.Index());
            }
            
            return View(model);
        }
    }
}
